<%@ page language="java" import="java.util.*,com.ts.common.util.bean.*,com.ts.util.connDB.*,com.ts.web.service.ICommonService,com.ts.common.util.BeanFactory,java.sql.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %> 
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>" />
    
<TITLE>办公室装修,办公室装修案例,上海同圣建筑装饰工程有限公司</TITLE>
 <meta name="keywords"
			content="办公室装修,别墅装修,办公楼装潢,办公楼装修,厂房装修,旧房改造,酒店装潢,上海装修公司,房子装修,上海同圣建筑装饰工程有限公司" />
	<meta name="description"
			content="上海同圣建筑装饰工程有限公司是一家集设计、施工、配套设施服务、后期维护为一体的专业装饰公司。公司始终贯彻以人为本的经营方针，坚实的后备力量，一流的施工队伍， 跟踪服务，踏实的工作作风，合理的工程报价，使我们成为上海专业以办公楼装修为主的专业装饰装修公司之一，并在上海及长江三角众多领域中拥有大量成功案例。装修热线：021-52698508" />


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/layout.css" rel="stylesheet" type="text/css" />

</head>

<body id="page2" BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="images/bg.jpg" > 
  <div>
     <jsp:include page="public/top_2.jsp" />
  </div>
<div class="w">
    
    <div id="main">		
  <TABLE border=0 cellSpacing=0 cellPadding=0 width=900 align=center bgcolor="#ffffff">
  <TBODY>
  <TR>
    <TD height=422 vAlign=top width=225>
      <TABLE border=0 cellSpacing=0 cellPadding=0 width=225 
      background=images/bani_06.gif height=52>
        <TBODY>
        <TR>
          <TD width=39>&nbsp;</TD>
          <TD vAlign=top width=186>
            <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
              <TBODY>
              <TR>
                <TD height=18>&nbsp;</TD></TR>
              <TR>
                <TD height=24 align=left><SPAN class=mieeend><STRONG><A 
                  href="item.jsp">经营项目</A></STRONG></SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

<%
    ICommonService ic = (ICommonService) BeanFactory
			.getBean(BeanFactory.COMMONSERVICE);
 	List<Itemmm> list = null;
    list = ic.getItemmm();


   for(Itemmm itemmm : list){
  %>
      <TABLE border=0 cellSpacing=0 cellPadding=0 width=225 
      background=images/bani_10.gif height=32>
        <TBODY>
        <TR>
          <TD width=58>&nbsp;</TD>
          <TD class=fontton width=167 align=left><A 
            href="common.do?method=show&itemmmid=<%=itemmm.getId() %>"><%=itemmm.getTitle() %></A></TD></TR></TBODY></TABLE>

<%} %>
      
     
<jsp:include page="public/hangye.jsp" />



      <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
        <TBODY>
        <TR>
          <TD><IMG border=0 src="images/bani_28.gif" width=225 
            height=244 useMap=#Map></TD></TR></TBODY></TABLE><MAP id=Map 
        name=Map><AREA href="common.do?method=order" shape=rect 
        coords=12,190,209,230></MAP></TD>
    <TD vAlign=top background=images/lineone2.gif >
      <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%" height=73>
        <TBODY>
        <TR>
          <TD><IMG src="images/lineone.gif" width=21 
        height=117></TD></TR></TBODY></TABLE></TD>
    <TD vAlign=top width=660>
      <TABLE border=0 cellSpacing=0 cellPadding=0 width=610 
      background=images/bani_08.gif height=61>
        <TBODY>
        <TR>
          <TD width=45>&nbsp;</TD>
          <TD align=left>
            <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
              <TBODY>
              <TR>
                <TD height=62 width="100%" colspan="2">
                  <DIV 
                  style="BACKGROUND-IMAGE: url(images/binai-k.gif); WIDTH: 18px; FLOAT: left; HEIGHT: 62px"></DIV>
                  <DIV 
                  style="BACKGROUND-IMAGE: url(images/binai-b.gif); FLOAT: left; HEIGHT: 62px">
                  <DIV style="PADDING-TOP: 18px" 
                  class=mieeend><STRONG>${itemmm.title }</STRONG></DIV></DIV>
                  <DIV 
                  style="BACKGROUND-IMAGE: url(images/binai-l.gif); WIDTH: 18px; FLOAT: left; HEIGHT: 62px"></DIV></TD>
                </TR></TBODY></TABLE></TD>
          <TD width=45></TD></TR></TBODY></TABLE>
      <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
        <TBODY>
        <TR>
          <TD>&nbsp;</TD></TR></TBODY></TABLE>
      <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
        <TBODY>
        <TR>
          <TD height=231 width="2%">&nbsp;</TD>
          <TD vAlign=top width="98%" align=left>
           
            <TABLE border=0 cellSpacing=15 cellPadding=0 width="100%">
              <TBODY>
              <TR>
                <TD  vAlign=top> 
                 
                      
    <%!  int pageSize = 8;//每页显示的记录数
     int pageCount = 0;//总页数
%>			
				<%
    ResultSet rs = null;
    Statement stmt = null;
    Connection con = null;
    String itemmmid = request.getParameter("itemmmid");

    try {
         con = ConnDB.getConn();
         stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);//可滚动查询数据的结果集
         rs =   stmt.executeQuery("select * from Cases  where shanchu='1' and itemmmid = '"+itemmmid+"' order by phtime desc");
         rs.last(); //让游标到表中的最后一行
        int rowCount = rs.getRow(); //获取记录总数.
        //out.print("总记录数为"+rowCount);
        //总页数的计算公式
         pageCount = (rowCount % pageSize == 0) ? (rowCount / pageSize ) : (rowCount / pageSize +1);
        int showPage = 1;//当前页

    //取得用户所指定的页
     String goToPage = request.getParameter("showPage");
    if (goToPage == null){
         goToPage = "1";
     }
    
    //转换成整形
    try{
         showPage = Integer.parseInt(goToPage);
     }
    catch (NumberFormatException ex){
         showPage = 1;
     }
    
    //当前页小于等于第一页 则按第一页算 如果 当前页大于等于总页数则为最后页
    if(showPage <=1){
         showPage = 1;
     }
    else if(showPage >= pageCount){
         showPage =   pageCount;
     }
    
    //游标的位置 (当前页 - 1) * 页面大小 + 1
    int posion = (showPage -1 ) * pageSize + 1;
    //设置游标的位置 
     rs.absolute(posion);

%>
    
   <%
if(rowCount == 0){
%>
<h3><center><font color="red">对不起，系统正在维护！</font></center></h3>
      
  
<%
}else{
   int i =0;
   //循环显示表中的数据 pageSize(每页所显示的记录)
   //rs.isAfterLast() 游标是否在最后一行之后 说明后面已经没记录
  %> <div style="background-color:blue"> <ul style="float: left;">
 <%  while(i<pageSize && !rs.isAfterLast()){  
    
    %>
                         <li style="float: left;margin-left: 20px;margin-top: 5px;list-style-type: none;background-color: gray"><a href="common.do?method=showOne&id=<%=rs.getString("id") %>"><img src="<%=rs.getString("url") %>" width="250" height="215" alt="<%=rs.getString("title") %>" /></a></li>
                   <%rs.next();i++;}
                   %>
                   </ul></div><%}%>
     
     <%
		 int cun = rowCount;
	 %>


<div  id="lvpagedown">
			<form action="" name="customerForm" method="post">
				          <table  width="455px" style="margin-left:15px;margin-top: 20px;padding-top: 20px;" >
<tr>
			<td align="right" >
							共<%=cun%>条信息  当前第<%=showPage%>页  共有<%=pageCount%>页
                            
                            <%if(showPage == 1){%>     
                                                                                首页
                            <%}else{ %>
                            <a href="common.do?method=show&itemmmid=<%=itemmmid %>&showPage=1" style="color: blue;">首页</a>                           
                             <%} %>
                            
                            <%if(showPage > 1){%>
                                 <a href="common.do?method=show&itemmmid=<%=itemmmid %>&showPage=<%=showPage-1%>" style="color: blue;">上一页</a>
                             <%}else{%> 
                                                                                    上一页
                              <%} %>                          
                            
                          
                             <%if(showPage < pageCount){%>
                                <a href="common.do?method=show&itemmmid=<%=itemmmid %>&showPage=<%=showPage+1%>" style="color: blue;">下一页</a>
                             <%}else{%> 
                                                                                         下一页
                              <%} %> 
                          
                           <%if(showPage == pageCount){%>     
                                                                                尾页
                            <%}else{ %>
                            <a href="common.do?method=show&itemmmid=<%=itemmmid %>&showPage=<%=pageCount%>" style="color: blue;">尾页</a>                          
                             <%} %>
                                                      
                            
							转到
							<select name="select" id="page" onchange="subPage()" style="width:42px; height: 18px;line-height:18px;border:1px #ccc solid">
								<%
								  for(int k=1;k<=pageCount;k++){
								   if(k == showPage){
								  %>
								  <option value=<%=k%> selected>
												<%=k%>
								  </option>
								  <% 
								  }else{
								  %> 
								  <option value=<%=k%> >
												<%=k%>
								  </option>
								  <%
								  }
								  }
								%>
								
							</select>
				
	</td>
		</tr>
	</table>

	</form>	
			
		</div>
		
		
		
		<% 

}  catch (Exception e) {
  e.printStackTrace();
}finally{
 try{
     rs.close();
     stmt.close();
     con.close();
 }catch(Exception ee){
    ee.printStackTrace();
 }
}


%>     
                       
                  </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
    </div>
 </div>	 
  <div id="footer">
      <jsp:include page="public/foot.jsp" />
  </div>
<script type="text/javascript">
	
		function subPage(){
		   
		    var ss = customerForm.select.value;
		    
			document.forms.customerForm.action='common.do?method=show&itemmmid=<%=itemmmid %>&showPage=' + ss;
			
			document.forms.customerForm.submit();
		}
</script>
  </body>
</html>
